I want to convert Json string into array object.I have a JSON String like this.
{"label1":"Mindstick","label2":"123",}
and I want result like this
[{"label1":"Mindstick","label2":"123",}]
home / developersection / forums / convert json string to object
I want to convert Json string into array object.I have a JSON String like this.
{"label1":"Mindstick","label2":"123",}
and I want result like this
[{"label1":"Mindstick","label2":"123",}]
Anonymous User
23-Mar-2018This can be done like this ...Try to push that object into an array,
var xObj = {"label1":"Mindstick","label2":"123",}var xArr = [];
xArr.push(xObj);
console.log(JSON.stringify(xArr)); //
[{"label1":"Mindstick","label2":"123",}]